import os
import sys
import django

# 将项目目录task_platform加入到环境变量
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)

# 加载配置文件，并启动一个虚拟的django服务
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demo.settings')
django.setup()

from app01 import models
from app01.utils.encrypt.md5 import md5


# models.Administrator.objects.create(name='admin', password=md5("654"), mobile="13183066336")
# models.Administrator.objects.create(name="jk1997", password=md5('123456'), mobile="13183066321")
# models.Leval.objects.create()
# level_list=[]
# level_list.append(models.Leval(title="vip1",present=90))
# level_list.append(models.Leval(title="vip2",present=85))
# level_list.append(models.Leval(title="vip3",present=80))
# models.Leval.objects.bulk_create(level_list)
# models.Leval.objects.create(title="vip5",present=70)
# models.Customer.objects.create(name="xiaoming",password=md5('123456'),mobile="13183066336",leval_id='1')
for i in range(303,304):
    models.Customer.objects.create(
        name="jk_{}".format(i),
        password=md5("123456"),
        mobile="13183066336",
        leval_id="1"
    )